package com.gzdh.dishrecognition.emu;

public enum BleKeyboardEmus {

    K20("300000", 1),

    K11("", 0),

    K9("210200",2),

    K16("110000", 3),

    K8("8F0000", 4),

    K14("420000", 5),

    K19("440000", 6),

    K21("410000", 7),

    K12("450000", 8),

    K24("430000", 9),

    K15("240200", 10),

    K10("400000", 11),

    K23("230200", 12),

    K17("E90000", 13),

    K26("9C0000", 14),

    K6("E20000", 15),

    K5("EA0000", 16),

    K27("9D0000", 17),

    K25("560000", 18),

    K13("3B0000", 19),

    K4("3D0000", 20),

    K1("3E0000", 21);

    private String value;

    private int code;

    private BleKeyboardEmus(String value, int code) {
        this.value = value;
        this.code = code;
    }

    // 根据value返回枚举类型,主要在switch中使用
    public static BleKeyboardEmus getByValue(String value) {
        for (BleKeyboardEmus code : values()) {
            if (code.getValue().equals(value)) {
                return code;
            }
        }
        return null;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }
}
